import { Component } from 'react';
import { Layout, Menu, Icon } from 'antd';
import Link from 'umi/link';

const { Header, Footer, Sider, Content } = Layout;

// 引入子菜单组件
const SubMenu = Menu.SubMenu;

export default class BasicLayout extends Component {
  render() {
    return (
      <Layout>
        <Sider width={256} style={{ minHeight: '100vh' }}>
          <div style={{ height: '32px', background: 'rgba(255,255,255,.2)', margin: '16px'}}/>
          <Menu theme="dark" mode="inline" defaultSelectedKeys={['1']}>
            <Menu.Item key="test"><Link to="/User/Test"><Icon type="pie-chart" /><span>Test</span></Link></Menu.Item>

            <Menu.Item key="1"><Link to="/User/Login"><Icon type="pie-chart" /><span>登录</span></Link></Menu.Item>

            <SubMenu
              key="sub.account"
              title={<span><Icon type="dashboard" /><span>财务</span></span>}
            >
              <SubMenu
                key="sub.account.config01"
                title={<span><Icon type="dashboard" /><span>出厂配置</span></span>}
              >

                 <Menu.Item key="account.account"><Link to="/AccountConfig/AccountAccounts">科目表</Link></Menu.Item>
                 <Menu.Item key="account.account.tag"><Link to="/AccountConfig/AccountAccountTags">报表项目</Link></Menu.Item>
                 <Menu.Item key="account.sub.account"><Link to="/AccountConfig/AccountSubAccounts">明细科目表</Link></Menu.Item>
                 <Menu.Item key="account.journal1"><Link to="/AccountConfig/AccountJournals1">凭证类型</Link></Menu.Item>
              </SubMenu>
              <SubMenu
                key="sub.account.config1"
                title={<span><Icon type="dashboard" /><span>明细科目配置</span></span>}
              >
                 <Menu.Item key="res.partner"><Link to="/AccountConfig/ResPartners">业务伙伴</Link></Menu.Item>
                 <Menu.Item key="product.product"><Link to="/AccountConfig/ProductProducts">产品服务</Link></Menu.Item>
                 <Menu.Item key="account.analytic.account"><Link to="/AccountConfig/AnalyticAccounts">辅助核算科目</Link></Menu.Item>
              </SubMenu>
              <SubMenu
                key="sub.account.config2"
                title={<span><Icon type="dashboard" /><span>资金账簿配置</span></span>}
              >
                 <Menu.Item key="account.journal"><Link to="/AccountConfig/AccountJournals">资金账簿</Link></Menu.Item>
                 <Menu.Item key="res.bank"><Link to="/AccountConfig/ResBanks">银行</Link></Menu.Item>
                 <Menu.Item key="res.partner.bank"><Link to="/AccountConfig/ResPartnerBanks">银行账号</Link></Menu.Item>

              </SubMenu>

              <SubMenu
                key="sub.account.init"
                title={<span><Icon type="dashboard" /><span>期初数</span></span>}
              >
                 <Menu.Item key="account.balance.open"><Link to="/AccountMove/AccountBalanceOpen">期初余额</Link></Menu.Item>

              </SubMenu>

              <SubMenu
                key="sub.account.cash"
                title={<span><Icon type="dashboard" /><span>出纳日常业务</span></span>}
              >
                 <Menu.Item key="account.payment1"><Link to="/AccountPayment/Payments1">收款单</Link></Menu.Item>
                 <Menu.Item key="account.payment2"><Link to="/AccountPayment/Payments2">付款单</Link></Menu.Item>
                 <Menu.Item key="account.payment3"><Link to="/AccountPayment/Payments3">内部转款单</Link></Menu.Item>
              </SubMenu>

              <SubMenu
                key="sub.account.move"
                title={<span><Icon type="dashboard" /><span>会计日常业务</span></span>}
              >
                 <Menu.Item key="account.move"><Link to="/AccountMove/AccountMoves">凭证制作</Link></Menu.Item>
                 <Menu.Item key="account.move.line"><Link to="/AccountMove/AccountMoveLines">凭证明细查看</Link></Menu.Item>
              </SubMenu>


              <SubMenu
                key="sub.account.month"
                title={<span><Icon type="dashboard" /><span>会计月末结转</span></span>}
              >
                 <Menu.Item key="account.post.profit"><Link to="/AccountMove/PostProfit">结转利润</Link></Menu.Item>
                 <Menu.Item key="account.post.balance"><Link to="/AccountMove/PostBalance">结转余额</Link></Menu.Item>
              </SubMenu>

              <SubMenu
                key="sub.account.report"
                title={<span><Icon type="dashboard" /><span>财务报表</span></span>}
              >
                 <Menu.Item key="account.report.balance"><Link to="/AccountReport/ReportBalance">科目余额表</Link></Menu.Item>
                 <Menu.Item key="account.report.balance2"><Link to="/AccountReport/ReportMoveSum">凭证汇总表</Link></Menu.Item>
                 <Menu.Item key="account.report.detail.ledger"><Link to="/AccountReport/ReportDetailLedger">明细账</Link></Menu.Item>
                 <Menu.Item key="account.report.general.ledger"><Link to="/AccountReport/ReportGeneralLedger">总账</Link></Menu.Item>
                 <Menu.Item key="account.report.balance.sheet"><Link to="/AccountReport/ReportBalanceSheet">资产负债表</Link></Menu.Item>
                 <Menu.Item key="account.report.profit.sheet"><Link to="/AccountReport/ReportProfitSheet">利润表</Link></Menu.Item>
              </SubMenu>

              <SubMenu
                key="sub.account.move.1"
                title={<span><Icon type="dashboard" /><span>发票和税务</span></span>}
              >
                 <Menu.Item key="account.invoice"><Link to="/AccountInvoice/Invoices">发票/账单</Link></Menu.Item>
                 <Menu.Item key="account.move.1"><Link to="/AccountTax/AccountMoveLinesTax">税务处理</Link></Menu.Item>
              </SubMenu>

              <SubMenu
                key="sub.account.stock"
                title={<span><Icon type="dashboard" /><span>库存处理</span></span>}
              >
                 <Menu.Item key="account.move.2"><Link to="/AccountStock/AccountMoves2">流程</Link></Menu.Item>
                 <Menu.Item key="account.stock"><Link to="/AccountStock/Stocks">出入库单</Link></Menu.Item>
                 <Menu.Item key="account.stock.open"><Link to="/AccountStock/StocksOpen">期初数</Link></Menu.Item>
                 <Menu.Item key="account.stock.in.material"><Link to="/AccountStock/StocksInMaterial">原材料入库</Link></Menu.Item>
                 <Menu.Item key="account.stock.out.material"><Link to="/AccountStock/StocksOutMaterial">原材料出库</Link></Menu.Item>
                 <Menu.Item key="account.stock.in.semiproduct"><Link to="/AccountStock/StocksInSemiProduct">半成品入库</Link></Menu.Item>
                 <Menu.Item key="account.stock.in.product.production"><Link to="/AccountStock/StocksInProductProduction">成品生产入库</Link></Menu.Item>
                 <Menu.Item key="account.stock.in.product.purchase"><Link to="/AccountStock/StocksInProductPurchase">成品采购入库</Link></Menu.Item>
                 <Menu.Item key="account.stock.out.product"><Link to="/AccountStock/StocksOutProduct">成品出库</Link></Menu.Item>
              </SubMenu>

              <SubMenu
                key="sub.assert"
                title={<span><Icon type="dashboard" /><span>资产/折旧</span></span>}
              >
                 <Menu.Item key="account.assert"><Link to="/AccountAssert/Asserts">固定资产</Link></Menu.Item>
                 <Menu.Item key="account.assert1"><Link to="/AccountAssert/Asserts">无形资产</Link></Menu.Item>
                 <Menu.Item key="account.assert2"><Link to="/AccountAssert/Asserts">长期待摊费用</Link></Menu.Item>
              </SubMenu>


            </SubMenu>

            <SubMenu
              key="sub.sale"
              title={<span><Icon type="dashboard" /><span>销售</span></span>}
            >
              <Menu.Item key="res.partner"><Link to="/AccountConfig/ResPartners">业务伙伴</Link></Menu.Item>
              <Menu.Item key="product.product"><Link to="/AccountConfig/ProductProducts">产品服务</Link></Menu.Item>
              <Menu.Item key="sale.order"><Link to="/Sale/SaleOrders">销售订单</Link></Menu.Item>
            </SubMenu>


            <SubMenu
              key="sub.hr"
              title={<span><Icon type="dashboard" /><span>人力资源</span></span>}
            >
               <Menu.Item key="hr.employee"><Link to="/HR/HrEmployees">员工</Link></Menu.Item>
               <Menu.Item key="hr.contract"><Link to="/HR/HrContracts">合同</Link></Menu.Item>
               <Menu.Item key="hr.payslip"><Link to="/HR/HrPayslips">工资</Link></Menu.Item>
               <Menu.Item key="hr.expense"><Link to="/HR/HrExpenses">费用</Link></Menu.Item>
            </SubMenu>


            {/*
            */}


          </Menu>
        </Sider>
        <Layout >
          <Header style={{ background: '#fff', textAlign: 'center', padding: 0 }}>Header</Header>
          <Content style={{ margin: '24px 16px 0' }}>
            <div style={{ padding: 24, background: '#fff', minHeight: 360 }}>
              {this.props.children}
            </div>
          </Content>
          <Footer style={{ textAlign: 'center' }}>Ant Design ©2018 Created by Ant UED</Footer>
        </Layout>
      </Layout>
    )
  }
}

/*
import styles from './index.css';

function BasicLayout(props) {
  return (
    <div className={styles.normal}>
      <h1 className={styles.title}>Yay! Welcome to umi!</h1>
      {props.children}
    </div>
  );
}

export default BasicLayout;
*/
